import 'package:flutter/material.dart';

class Login extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new Container(
        padding: const EdgeInsets.all(20),
        alignment: Alignment.center,
        height: 300,
        child: new Form(
          child: new Column(
            children: [
              new TextFormField(
                keyboardType: TextInputType.name,
                decoration: const InputDecoration(
                  hintText: 'username',
                  labelText: '用户名',
                  prefixIcon: const Icon(Icons.person),
                ),
              ),
              new TextFormField(
                keyboardType: TextInputType.visiblePassword,
                decoration: const InputDecoration(
                  hintText: 'password',
                  labelText: '密码',
                  prefixIcon: const Icon(Icons.lock),
                ),
              ),
              new Padding(
                padding: const EdgeInsets.symmetric(vertical: 16.0),
                child: new ElevatedButton(
                  onPressed: () {
                    Navigator.pushReplacementNamed(context, 'home');
                  },
                  child: new Text('Submit'),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
